/**
 * 其他API
 */
import express from "express";
const other = express.Router();
import { dbContext } from "../../database/initialize.js";

// 测试api
other.get("/other/test", (req, res) => {
    try {
        if(!dbContext.db) throw new Error("数据库连接未初始化");
        dbContext.db.exec("SELECT 1");
        res.status(200).json({success: true, message: "服务运行正常", timestamp: new Date().toISOString()})
    } catch (error) {
        res.status(500).json({success: false, message: "服务异常：" + error.message, timestamp: new Date().toISOString()});
    }
});

export default other;